package org.blueoxygen.cimande2.ma.gene.adapter;

import java.util.List;

import org.blueoxygen.cimande2.ma.gene.entity.Person;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class PersonAdapter extends BaseAdapter {
	private Context context;
	private List<Person> listPhonebook;
	
	public PersonAdapter(Context context, List<Person> listPhonebook){
		this.context = context;
		this.listPhonebook = listPhonebook;
	}
	public int getCount() {
		return listPhonebook.size();
	}

	public Object getItem(int position) {
		return listPhonebook.get(position);
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View view, ViewGroup viewGroup) {
		Person entry = listPhonebook.get(position);
		return new PersonAdapterView(context,entry);
	}
}
